<template>
  <div class="playmusic">
    <div class="song_img">
      <img :src="img" alt="" />
    </div>
    <audio
      :src="url"
      controls="controls"
      autoplay="autoplay"
      class="audio"
    ></audio>
    <p class="play_name">{{ name }}</p>
  </div>
</template>

<script>

import {mapState} from 'vuex';
export default {
  data() {
    return {
    };
  },
  props:['img','name','url'],
  
    
  watch:{
    name:{
      handler(){
        this.$bus.$on('show_mv')
      }
    }
  }
};
</script>

<style lang="less">
.playmusic {
  display: flex;
  position: fixed;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100px;
  background-color: #f1f3f4;
  .song_img {
    flex: 1;

    img {
      border-radius: 5px;
      width: 100px;
      height: 100%;
      margin-left: 20px;
    }
  }
  .play_name {
    position: absolute;
    left: 130px;
    top: 5px;
  }
  .audio {
    flex: 9;
    padding-top: 25px;
    line-height: 100px;
  }
}
</style>